<?php 
/**
* @package DomDB.Test
* @author Oliver Leisalu
*/
class DomDBTestComplexObject extends DomDBObject {
	
	protected $name;
	protected $description;
	protected $time;
	
	protected $object;
	protected $link;
	
	protected $list;
	protected $linkList;
	protected $orderedList;
	protected $orderedLinkList;
	//protected $keyLinkList;
	protected $orderedMultiList;
	
	public function __construct( $name ) {
		$this->name = $name;
		$this->time = new DomDateTime('now');
		
		$this->list = new DomDBList( $this, 'list');
		$this->linkList = new DomDBLinkList( $this, 'linkList');
		$this->orderedList = new DomDBOrderedList( $this, 'orderedList');
		$this->orderedLinkList = new DomDBOrderedLinkList( $this, 'orderedLinkList');
		//$this->keyLinkList = new DomDBOrderedLinkList( $this, 'keyLinkList');
		$this->orderedMultiList = new DomDBOrderedMultiList( $this, 'orderedMultiList');
	}
	
	public static function serializeMetadata() {
		$time = microtime(true);
		DomDBMetadata::installMetadata( __CLASS__, array(
			new DomDBField_Field('name','text'),
			new DomDBField_Field('description','text'),
			new DomDBField_DateTime('time'),
			
			new DomDBField_Object('object'),
			new DomDBField_ObjectLink('link'),
			
			new DomDBField_List('list','DomDBTestComplexObject'),
			new DomDBField_LinkList('linkList','DomDBTestComplexObject'),
			new DomDBField_OrderedList('orderedList','DomDBTestComplexObject'),
			new DomDBField_OrderedLinkList('orderedLinkList','DomDBTestComplexObject'),
			new DomDBField_OrderedMultiList('orderedMultiList'),
			//new DomDBField_OrderedLinkList('keyLinkList','DomDBTestComplexObject'),
			
		), array('name'));
	}

}
?>